PreviousNextTracker indexSee it online !

(69/185) 159 - Console: Multiple tabs for system shell

It would be nice to be able to have more than one system shell open at a time in the Console plugin, maybe a multiple tab interface would work.

Submitted daleanson - 2009-12-17 05:52:38 Assigned daleanson
Priority 5 Labels
Status open Group
Resolution None

Comments

2010-01-18 03:37:31
ezust

Funny, that was one of the first things I thought about adding to it, and Slava told me not to, since we can create multiple separate floating instances. But that's not the same, really?

Then I thought, oh wait, mydoggy lets you share tabs between dockables. What if you create "new floating instances" and bring them togehter in tabs, can achieve the same thing?

But it seems MyDoggy does not allow "new floating instances".

If MyDoggy allowed "new floating instance" then you could get multiple console tabs for any shell.



2012-06-07 22:31:34
ezust

To whoever volunteers to do this:
please don't use the built-in JTabbedPane though, it wastes vertical space.

It might be better to just add a "+" button that creates another shell switcher combobox (perhaps in a small panel) all in the same horizontal layout that has the current shell switcher combobox.

Then the comboboxes can be used as the tab buttons.

2016-05-30 23:34:49.650000
daleanson

- **assigned_to**: Dale Anson
- **Group**: -->

2016-05-30 23:34:49.871000
daleanson

First draft is checked in at revision 24398. It's not quite done, I need to put some strings into the properties file, but I think the rest is working pretty well.

2016-06-04 00:33:56.486000
daleanson

I've checked in a new version at revision 24401. This removes the dependency on the latest version of jEdit code, but now has a dependency on the latest CommonControls 1.7.5 code. This seems to be working well, but there is still some code clean up to be done before it can be released.

2016-06-05 21:22:16.051000
ezust

A couple of comments.

1. additional buttons to represent the tabs to the right of the combobox? I don't see anything resembling tabs now.


2. why only system and beanshell and not the other plugin-provided shells?



2016-06-06 02:34:39.231000
daleanson

For 1, the existing drop down seems sufficient. For 2, those are the only two that  i know the code to create. Service manager does not expose the details of shells provided by other plugins. Some adjustment to service manager would allow discovery of those other shells like ssh

2016-06-06 22:49:43.258000
ezust

I have my default shell set to System. I have no user shells at all. And yet, the shell keeps switching to Beanshell now, when it did not before your recent changes.

2016-06-07 03:05:31.050000
daleanson

I'm back in town tomorrow I'll ake look then.

2016-06-07 19:43:15.665000
ezust

It seems to happen at least once after each jEdit startup. I open a new Console window and it indicates System is active.
The first command I enter is parsed by Beanshell, and then it switches to beanshell right after that.

2016-06-07 23:13:17.625000
daleanson

Okay, I see that. A question, though, there are two properties, one for the default shell as set in the options, and one for the last used shell. When Console starts, I'm assuming the dropdown should be set to the last used shell if it is set in the property, the default shell otherwise. Does that sound right?

Also, about ServiceManager, to register a service, ServiceManager needs a class name, a name for the service, and the beanshell code that creates the service, in other words, all the info provided in the services.xml file. For Console to create a new service of an existing shell type, like ssh, for example, then Console also needs that info to pass to ServiceManger. The classname and service name are not a problem, but I don't know where to get the beanshell code. ServiceManager has it, but doesn't provide any way to share it outside of itself. Any ideas? I could use a crappy hack like the Beauty plugin does to reset the indent rules in Mode.java, but I'm always a little hesitant to do that.

2016-06-07 23:51:12.750000
ezust

On Tue, Jun 7, 2016 at 4:13 PM, Dale Anson <daleanson@users.sf.net> wrote:

> Okay, I see that. A question, though, there are two properties, one for
> the default shell as set in the options, and one for the last used shell.
> When Console starts, I'm assuming the dropdown should be set to the last
> used shell if it is set in the property, the default shell otherwise. Does
> that sound right?
>

Yes.


>
> Also, about ServiceManager, to register a service, ServiceManager needs a
> class name, a name for the service, and the beanshell code that creates the
> service, in other words, all the info provided in the services.xml file.
> For Console to create a new service of an existing shell type, like ssh,
> for example, then Console also needs that info to pass to ServiceManger.
> The classname and service name are not a problem, but I don't know where to
> get the beanshell code. ServiceManager has it, but doesn't provide any way
> to share it outside of itself. Any ideas? I could use a crappy hack like
> the Beauty plugin does to reset the indent rules in Mode.java, but I'm
> always a little hesitant to do that.
>

Do you need the code, or the service object? why not just call
"ServiceManager.getService()" which returns the object. Then you don't need
the code.


public static Object getService(String clazz, String name)

2016-06-08 00:07:05.243000
ezust

Let me qualify the answer to your first question:
In plugin options Console General - "Default Shell", you can select default shell, and in that combo, you can choose "last selected".
"Last Used" shell property is only used if last selected is chosen in that plugin options combobox.

2016-06-08 14:17:51.738000
daleanson

No, the code is necessary. The getService method doesn't return a new shell, it returns an existing shell, so if I call getService("console.Shell", "System", I get the already existing System shell. To create a new system shell (or BeanShell shell or whatever), it's necessary to have the code and call registerService("console.Shell", name, "new console.SystemShell(name)", null); This creates a new System shell with a different name, then it can run different commands.